<?php get_instance()->view('common/header');?>
<style type="text/css">
    .text-val {
        padding-top: 3px;
        padding-left: 0;
    }

    .text-label {
        color: grey;
        text-align: right;
    }

    .btn-group, .btn-group-vertical {
        display: inline-block;
        position: absolute;
        vertical-align: middle;
    }

    .sale-summary li:first-child {
        border-top: medium none;
    }

    .sale-summary li {
        border-top: 1px solid #eee;
        overflow: hidden;
        padding: 10px 0;
    }

    .sale-summary li .sale-info {
        color: #646464;
        float: left;
        font-size: 14px;
        text-transform: uppercase;
    }

    .sale-summary li .sale-num {
        color: #169ef4;
        float: right;
        font-size: 20px;
        font-weight: 300;
    }

    .description-box img {
        width: 100%;
    }
    .table-scrollable > .table > thead > tr > th, .table-scrollable > .table > tbody > tr > th, .table-scrollable > .table > tfoot > tr > th, .table-scrollable > .table > thead > tr > td, .table-scrollable > .table > tbody > tr > td, .table-scrollable > .table > tfoot > tr > td{
        word-break:break-all;
    }
    .image>img{max-width: 100px;max-height: 100px}
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"><?php echo $title; echo $type == 'merchant' ? ' - 卖家秀' : ' - 买家秀'?></h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('friends');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li><i class="fa fa-home"></i><a href="<?php echo getUrl('friends');?>">发现管理<i class="fa fa-angle-right"></i></a></li>
                        <li><a href="javascript:void(0);"><?php echo $title?></a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-12 profile-info">
                            <div class="row">
                                <div class="col-md-12">
                                    <div style="border: 1px solid #ddd; padding: 10px; margin-bottom: 30px;">
                                        <div class="row">
                                            <div class="col-md-1">
                                                <ul class="list-unstyled profile-nav">
                                                    <li><img src="<?php echo $info['portrait']['xs']?>" class="img-responsive" alt=""></li>
                                                </ul>
                                            </div>
                                            <div class="col-md-11">
                                                <div class="row">
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">发布人：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['nickname'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">地址：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['address'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">GPS：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['latitude'].','.$info['longitude'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">浏览次数：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['browse_number'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">状态：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['addtime'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-6">
                                                        <div class="form-group">
                                                            <label class="col-md-4 control-label text-label">发布状态：</label>
                                                            <div class="col-md-8 text-val"><?php echo $info['status_str'];?></div>
                                                        </div>
                                                    </div>

                                                    <div class="col-md-12">
                                                        <div class="form-group">
                                                            <label class="col-md-2 control-label text-label">发布内容：</label>
                                                            <div class="col-md-10 text-val"><?php echo $info['content'];?></div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-12">
                                                        <div class="form-group">
                                                            <label class="col-md-2 control-label text-label">图片：</label>
                                                            <div class="col-md-10 image">
                                                                <?php if (!empty($info['image'])): foreach ($info['image'] as $v):?>
                                                                <img src="<?php echo $v['xs']?>" alt="">
                                                                <?php endforeach; endif;?>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-12">
                                                        <div class="form-group">
                                                            <label class="col-md-2 control-label text-label">视频路径：</label>
                                                            <div class="col-md-10 text-val">
                                                                <a href="<?php echo $info['video'];?>" target="_blank"><?php echo $info['video'];?></a>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--end col-md-8-->
                    </div>
                    <!--end row-->
                    <div class="tabbable tabbable-custom tabbable-custom-profile">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab_1_1" data-toggle="tab">评论记录</a></li>
                            <li><a href="#tab_1_2" data-toggle="tab"> 点赞记录 </a></li>
                        </ul>
                        <div class="tab-content">
                            <!--评论记录-->
                            <div class="active tab-pane " id="tab_1_1">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <div class="table-actions-wrapper"> <span> </span></div>
                                        <table class="table table-bordered table-hover" id="datatable_comment">
                                            <thead>
                                                <tr role="row" class="heading">
                                                    <th width="20%">评论者</th>
                                                    <th width="30%">评论内容</th>
<!--                                                    <th width="30%">回复内容</th>-->
                                                    <th width="10%">添加时间</th>
                                                    <th width="10%">操作</th>
                                                </tr>
                                                <tr>
                                                    <th><input class="form-control form-filter input-sm" name="consumer" type="text"></th>
                                                    <th></th>
<!--                                                    <th></th>-->
                                                    <th>
                                                        <div class="margin-bottom-5">
                                                            <input class="form-control form-filter input-sm" name="send_date_from" dp placeholder="从" type="text">
                                                        </div>
                                                        <input class="form-control form-filter input-sm" name="send_date_to" dp placeholder="到" type="text" >
                                                    </th>
                                                    <th>
                                                        <div class="btn-group">
                                                            <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                            <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                            <ul role="menu" class="dropdown-menu pull-right">
                                                                <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                                            </ul>
                                                        </div>
                                                    </th>
                                                </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>

                            <!--点赞记录-->
                            <div class="tab-pane" id="tab_1_2">
                                <div class="table-responsive">
                                    <div class="table-container">
                                        <div class="table-actions-wrapper"> <span> </span></div>
                                        <table class="table table-bordered table-hover" id="datatable_praise">
                                            <thead>
                                            <tr role="row" class="heading">
                                                <th width="50%">点赞者</th>
                                                <th width="50%">点赞时间</th>
                                            </tr>
                                            </thead>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var id = <?php echo $info['id'];?>;
    var type = "<?php echo $type;?> ";

    $(function(){
        datatable_init({
            src: $("#datatable_comment"),
            sAjaxSource: "<?php echo getUrl('friends/getCommentList?id=');?>"+id+"&type="+type,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,3]
            }]
        });
        datatable_init({
            src: $("#datatable_praise"),
            sAjaxSource: "<?php echo getUrl('friends/getPraiseList?id=');?>"+id+"&type="+type,
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [0]
            }]
        });

        $('[dp]').not("[noinit]").datepicker({
            changeMonth: true,
            autoclose: true,
            format: "yyyy-mm-dd",
            language: 'zh-CN'
        });
    });

    //异步调用
    function ajaxRequestCallBack(e){
        $('#datatable_comment').dataTable().fnDraw(true);  // 商品分类
        $('#datatable_praise').dataTable().fnDraw(true);  // 商品分类
    }
</script>
</body>
</html>